<?php
class UploadsController extends AppController{
	var $helpers = array('Javascript');	
	function index(){
		$data=$this->Upload->findAll();
		$this->set('data', $data);
		$this->set('i',1);
	}	
	function add(){						
		
	}	
	function files(){							
		if(!empty($this->data)){		
			$this->data['Upload']['user_id']=1;
			$this->data['Upload']['date']=date("Y-m-d");
			$this->data['Upload']['time']=date("G:i:s");			
					
			$this->Upload->save($this->data);
			
			$this->set('hostpitalname', $this->data['Upload']['hospitalname']);
			$this->set('month', $this->data['Upload']['month']);			
		}
	}
	function detail($hospitalname, $month){		
		$this->data['Upload']['user_id']=1;
		$this->data['Upload']['date']=date("Y-m-d");
		$this->data['Upload']['time']=date("G:i:s");
		$this->data['Upload']['hospitalname']=$hospitalname;
		$this->data['Upload']['month']=$month;
		
		$this->Upload->save($this->data);			
		//$this->lastid=$this->Upload->id;
		$this->lastid=5353;
		//$this->requestAction('/details/update/', array('pass' => array($this->id)));	
	}
	function getId(){
		return $this->lastid;
	}
	function confirmation(){
		$this->set('id', $this->id);
		
		$this->requestAction('/details/update/', array('pass' => array($this->id)));
	}	
}
?>